<?php
class Adminmodel extends CI_Model
{
  function login($username, $password)
  {
    $this->db->select('admin_id, username, password');
    $this->db->where('username', $username);
    $this->db->where('password', MD5($password));
    $this->db->limit(1);
    $query = $this->db->get('admins');

    if($query->num_rows() == 1) {
      return $query->row_array();
    } else {
      return false;
    }
  }
}